package com.ddshuai.tree.binarysearch;

import java.util.StringJoiner;

/**
 * 描述
 *
 * @author ddshuai
 * @date 2019-04-19 10:10
 **/
public class TreeNode {
    /**
     * 数据
     */
    public Integer data;
    /**
     * 右子节点
     */
    public TreeNode right;
    /**
     * 左子节点
     */
    public TreeNode left;

    public TreeNode(Integer data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", TreeNode.class.getSimpleName() + "[", "]")
                .add("data=" + data)
                .add("right=" + right)
                .add("left=" + left)
                .toString();
    }
}
